<div id="login-new">
    <div class="login-wrapper clearfix">
        <div class="login-new-bgimg pull-left">

        </div>
        <div class="login-new-workplace-wrapper pull-left">
            <div class="login-new-workplace">
                <div class="login-new-company">
                    欢迎登录综合管理系统

                </div>
                <!-- 账号密码登录 -->
                <div class="login-new-form" *ngIf="!isPhone">
                    <div class="form-item">
                        <input type="text" [(ngModel)]="user.code" (focus)="error.msg =''" name="user" pInputText placeholder="请输入用户名/手机号" (keyUp.enter)="login()">
                        <span class="item-icon fa fa-user"></span>
                    </div>
                    <div class="form-item">
                        <input type="password" onpaste="return false;" [(ngModel)]="accountPw" oncopy="return false;" maxlength="12" (focus)="error.msg =''" name="pw" pInputText placeholder="密码" (keyUp.enter)="login()" onkeyup="value=value.replace(/[^\w]/ig,'')">
                        <span class="item-icon fa fa-lock"></span>
                    </div>
                    <!-- <div class="form-item" *ngIf="hasCheckCode">
                        <input type="text" [(ngModel)]="user.isCheckCode" maxlength="4" name="checkcode" pInputText placeholder="请输入验证码" (focus)="error.msg =''" (keyUp.enter)="login()">
                        <span class="img-coder">
                                 <img [src] = "checkCodeSrc" (click) = "getCheckCode('user')" class="width-full height-full">
                            </span>
                        <span class="item-icon fa fa-key"></span>
                    </div> -->
                    <div class="form-item">
                        <input type="text" [(ngModel)]="imageCode" maxlength="4" name="imageCode" pInputText placeholder="请输入验证码" (focus)="error.msg =''" (keyUp.enter)="login()">
                        <span class="img-coder">
                                 <img [src] = "checkCodeSrc" (click) = "getCheckCode('user')" class="width-full height-full">
                            </span>
                        <span class="item-icon fa fa-key"></span>
                    </div>
                    <div class="error-item" [style.height.px]="error?.msg?54:0">
                        <span class="form-error-tip">
                            <i class="fa fa-minus-circle"></i>
                            <span>{{error?.msg}}</span>
                        </span>
                    </div>
                    <div class="form-submit" (click)="login()">
                        登录
                    </div>
                    <div class="form-forgot" (click)="forgotPassword()">
                        忘记登录密码？
                    </div>
                </div>

                <!-- 手机号登录 -->
                <div class="login-new-form" *ngIf="isPhone">
                    <div class="form-item">
                        <input type="text" [(ngModel)]="phone.code" maxlength="11" (focus)="phoneError.msg=''" name="phone" pInputText placeholder="请输入手机号" (keyUp.enter)="phoneLogin()">
                        <span class="item-icon fa fa-mobile"></span>
                    </div>
                    <div class="form-item">
                        <input type="text" [(ngModel)]="phone.phoneVerifyCode" (focus)="phoneError.msg=''" maxlength="4" name="phonecode" pInputText placeholder="请输入验证码">
                        <span class="img-coder">
                                 <div class="form-submit height-full width-full form-get-code" (click)="getPhoneCode()" [class.disabled]="gottenPhoneCode" >
                                        {{gottenPhoneCode?(countdown + 's'):'获取验证码'}}
                                 </div>
                            </span>
                        <span class="item-icon fa fa-send"></span>
                    </div>
                    <div class="form-item" *ngIf="hasPhoneTextCode">
                        <input type="text" [(ngModel)]="phoneTextCode" maxlength="4" name="phoneCheckcode" pInputText placeholder="请输入验证码" (focus)="phoneError.msg=''" (keyUp.enter)="phoneLogin()">
                        <span class="img-coder">
                                 <img [src] = "phoneTextCodeSrc" (click) = "getCheckCode('phone')" class="width-full height-full">
                            </span>
                        <span class="item-icon fa fa-key"></span>
                    </div>
                    <div class="form-normal-tip">为了您的账号安全，请使用手机验证码登录</div>
                    <div class="error-item" [style.height.px]="phoneError?.msg?54:0">
                        <span class="form-error-tip">
                            <i class="fa fa-minus-circle"></i>
                            <span>{{phoneError?.msg}}</span>
                        </span>
                    </div>
                    <div class="form-submit" (click)="phoneLogin()">
                        登录
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<div style="top: 30%;">
    <p-dialog header="修改密码" [(visible)]="isplay" [width]="480" [draggable]="false" modal="modal" (onHide)="close()" class="editPw">
        <div style="margin-top:28px">
            <span class="newPw-title font-size-18 color-333">新密码：</span>
            <input type="password" name="newCode" onpaste="return false" (focus)="forgotMsg=''" maxlength="12" pInputText placeholder="密码可设置6至12位，数字+字母组合" @flyOut class="login font-size-18 newPw" [(ngModel)]="newPw" onkeyup="value=value.replace(/[^\w]/ig,'')" (keyUp.enter)="pwSubmit(newPw,confirmPW)">
        </div>

        <div>
            <span class="newPw-title font-size-18 color-333">确认密码：</span>
            <input type="password" name="confirmCode" onpaste="return false" maxlength="12" (focus)="forgotMsg=''" pInputText placeholder="请与新密码保持一致" @flyOut class="login font-size-18 newPw" [(ngModel)]="confirmPW" onkeyup="value=value.replace(/[^\w]/ig,'')" (keyUp.enter)="pwSubmit(newPw,confirmPW)">
        </div>
        <div class="pw-tip font-size-14 color-ff0000">为了您的账号安全，请修改密码</div>
        <div class="sub-btn" style="margin-bottom: 28px;">
            <button pButton type="button" (click)="pwSubmit(newPw,confirmPW)" class="ui-button-success" style=" height: 40px; width:86px;" label="提交"></button>
        </div>
        <div>
            <error-bar [msg]="forgotMsg"></error-bar>
        </div>
    </p-dialog>
</div>
<p-growl [(value)]="msgs" [styleClass]="'center-message'"></p-growl>